package com.xm.springboot_spi;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Author：xm
 * Project：interview
 * Date：2025/9/1  23:41
 */

@Configuration
public class PayAutoConfiguration {

    @Bean
    @ConditionalOnProperty(name = "pay.type", havingValue = "wxpay")
    public IPayService paymentService() {
        return new WxPayService();
    }

    @Bean
    @ConditionalOnProperty(name = "pay.type", havingValue = "alipay")
    public IPayService alipayService() {
        return new AliPayService();
    }

}
